package algorithmTopics.string;

import java.util.Arrays;

public class test4 {

    public static void main(String[] args) {
        test4 test2 = new test4();

    }

    public boolean isAnagram(String s, String t) {
        if (s.length() != t.length()) {
            return false;
        }
        char[] chars = s.toCharArray();
        char[] array = t.toCharArray();
        Arrays.sort(chars);
        Arrays.sort(array);
        for (int i = 0; i < chars.length; i++) {
            if (chars[i] != array[i]) {
                return false;
            }
        }
        return true;
    }



}
